<!-- 万基版工作台页面 -->
<template>
	<view>
		<image src="/static/images/work1.jpg" mode="" class="img_bg"></image>
		<!-- <view :hidden="userFeedbackHidden" class="popup_content">
			<view class="" style="">
				<p type="default" style="font-size: 40upx; font-weight: 1000; color: gainsboro;  display: inline; margin-left:95%;" @click="hideDiv()">x</p>
			</view>
			<view class="popup_title">您的待巡检任务</view>
			<view class="" v-for="(item,index) in taskPosition" :key="index">
				<view class="">
					{{item.danger_name}}
				</view>
			</view>
			
		</view> -->
		<!-- <view class="popup_overlay" :hidden="userFeedbackHidden" @click="hideDiv()"></view> -->
		<view class="mask" v-show="mask_show">

		</view>
		<view class="" style="position: absolute; top: 0; width: 100%;">
			<view class="">
				<view class="margin-t30 margin-b30 text-bold text-48 " style="margin-left: 30upx;">{{company_name}}
				</view>
				<!-- #ifdef MP-WEIXIN -->
				<view class="roll">
					<swiper class="swiper" indicator-dots autoplay interval="3000" circular>
						<view class="">
							<swiper-item class="workSwiper" v-for="(item,index) in roll_banner" :key="index"
								@tap="banner_tap(item.content)">
								<image :src="item.file_url"></image>
							</swiper-item>
						</view>
					</swiper>
				</view>
				<!-- #endif -->
				<!-- #ifdef APP-PLUS -->
				<view class="roll">
					<swiper class="swiper" indicator-dots autoplay interval="3000" circular>

						<swiper-item class="workSwiper" v-for="(item,index) in roll_banner" :key="index"
							@tap="banner_tap(item.content)">
							<image :src="item.file_url"></image>
						</swiper-item>

					</swiper>
				</view>
				<!-- #endif -->
				<!-- #ifdef MP-ALIPAY -->
				<view class="roll">
					<swiper class="swiper" indicator-dots autoplay interval="3000" circular>
						<swiper-item class="workSwiper" v-for="(item,index) in roll_banner" :key="index"
							@tap="banner_tap(item.content)">
							<image :src="item.file_url"></image>
						</swiper-item>
					</swiper>
				</view>
				<!-- #endif -->
			</view>
			<view class="card1">
				<view class="text-36 text-bold">基本信息</view>
				<view class="display flex-wrap align-start">
					<block v-for="(item,index) in navBanner3" :key="index">
						<view class="button-st" @tap="toDetail(item.url)" hover-class="butt-h">
							<view class="father">
								<view class="siz_img" hover-class="big_img">
									<image :src="item.image" class="navImage">
									</image>
								</view>
							</view>
							<view class="">{{item.text}}</view>
						</view>
					</block>
				</view>
			</view>
			<view class="card1">
				<view class="text-36 text-bold">安全巡检</view>
				<view class="display flex-wrap align-start">
					<block v-for="(item,index) in navBanner1" :key="index">
						<view class="button-st" @tap="toDetail(item.url)" hover-class="butt-h">
							<view class="father">
								<view class="siz_img" hover-class="big_img">
									<image :src="item.image" class="navImage">
									</image>
								</view>
							</view>
							<view class="">{{item.text}}</view>
						</view>
					</block>
				</view>
			</view>
			<view class="zizeng">
				<view class="card1">
					<view class="text-36 text-bold">隐患排查</view>
					<view class="display flex-wrap align-start">
						<block v-for="(item,index) in navBanner2" :key="index">
							<view class="button-st" @tap="toDetail(item.url)" hover-class="butt-h">
								<view class="father">
									<view class="siz_img" hover-class="big_img">
										<image :src="item.image" class="navImage">
										</image>
									</view>
								</view>
								<view class="">{{item.text}}</view>
								<view class="conductSign" v-if="index==1">{{signNumber1}}</view>
								<view class="conductSign" v-if="index==2">{{signNumber2}}</view>
								<view class="conductSign" v-if="index==3">{{signNumber3}}</view>
							</view>
						</block>
					</view>
				</view>
			</view>
			<view class="card1" v-show="is_eqfc==1">
				<view class="text-36 text-bold">设备设施管理</view>
				<view class="display flex-wrap align-start">
					<block v-for="(item,index) in navBanner5" :key="index">
						<view class="button-st" @tap="toDetail(item.url)" hover-class="butt-h">
							<view class="father">
								<view class="siz_img" hover-class="big_img">
									<image :src="item.image" class="navImage">
									</image>
								</view>
							</view>
							<view class="">{{item.text}}</view>
							<view class="conductSign" v-if="index==1">{{signNumber6}}</view>
							<view class="conductSign" v-if="index==2">{{signNumber7}}</view>
						</view>
					</block>
				</view>
			</view>
			<view class="">
				<view v-show="false">
					<button type="default" @click="beginCanvas">开始绘图</button>
				</view>
				<image v-show="false" :src="canvasUrl" mode="widthFix"></image>
				<mosowe-canvas-image ref="mosoweCanvasComponents" @canvasImage="_canvasImage" :lists="lists"
					:height="lists[0].height" :width="lists[0].width" />
			</view>
			<view class="card1" v-show="is_caw==1">
				<view class="text-36 text-bold">自增隐患</view>
				<view class="display flex-wrap align-start">
					<block v-for="(item,index) in navBanner4" :key="index">
						<view class="button-st" @tap="toDetail(item.url)" hover-class="butt-h">
							<view class="father">
								<view class="siz_img" hover-class="big_img">
									<image :src="item.image" class="navImage">
									</image>
								</view>
							</view>
							<view class="">{{item.text}}</view>
							<view class="conductSign" v-if="index==2">{{signNumber4}}</view>
							<view class="conductSign" v-if="index==3">{{signNumber5}}</view>
						</view>
					</block>
				</view>
			</view>
			<view class="card1" v-if="viode_show == '147369'">
				<view class="text-36 text-bold">教育培训</view>
				<view class="display flex-wrap align-start">
					<block v-for="(item,index) in navBanner6" :key="index">
						<view class="button-st" @tap="toDetail(item.url)" hover-class="butt-h">
							<view class="father">
								<view class="siz_img" hover-class="big_img">
									<image :src="item.image" class="navImage">
									</image>
								</view>
							</view>
							<view class="">{{item.text}}</view>
						</view>
					</block>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	import amap from '../../components/amap-wx.130.js'
	import mosowe_canvas_image from "@/components/mosowe-canvas-image/mosowe-canvas-image.vue"
	export default {
		components: {
			mosowe_canvas_image
		},
		data() {
			return {
				taskPosition: [], //未巡检任务
				//userFeedbackHidden: false, // 默认隐藏
				banben: '',
				type: 1,
				version: 1,
				apk_url: '',
				uid: '',
				token: '',
				is_eqfc: '', //设备设施
				is_caw: '',
				signNumber1: 0,
				signNumber2: 0,
				signNumber3: 0,
				signNumber4: 0,
				signNumber5: 0,
				signNumber6: 0,
				signNumber7: 0,
				roll_banner: [], //滚动屏
				danger_status: '',
				company_name: 'XXX公司',
				phone: '',
				banner_text: '',
				lists: [{
						type: 'image',
						content: '',
						width: 100,
						height: 200,
						size: 10,
						x: 0,
						y: 0,
						align: 'left',
						arc: false,
						arcX: 30,
						arcY: 20,
						arcR: 20
					},

					{
						type: 'text',
						content: '姓名',
						width: 100,
						height: 200,
						x: 10,
						y: 30,
						color: '#ffffff',
						size: 15,
						// maxWidth: 100, 
						// align: 'left', 
					},
					{
						type: 'text',
						content: '时间',
						width: 100,
						height: 200,
						x: 10,
						y: 20,
						color: '#ffffff',
						size: 15,
						// maxWidth: 100, 
						// align: 'left', 
					},
					{
						type: 'text',
						content: '地点',
						width: 100,
						height: 200,
						x: 10,
						y: 20,
						color: '#ffffff',
						size: 15,
						// maxWidth: 100, 
						// align: 'left', 
					},


				],
				navBanner1: [{
						image: "/static/work/a.png",
						text: "扫码巡检",
						url: "/pages/workspace/workDetial/polling/polling"
					},
					{
						image: "/static/work/c.png",
						text: "巡检记录",
						url: "/pages/workspace/workDetial/form/form"
					},


				],
				navBanner2: [{
						image: "/static/work/j.png",
						text: "隐患记录",
						url: "/pages/workspace/workDetial/hiddenDangers/hiddenDangers"
					},
					{
						image: "/static/work/e.png",
						text: "隐患指派",
						url: "/pages/workspace/workDetial/zhipai/zhipai"
					},
					{
						image: "/static/work/d.png",
						text: "隐患处理",
						url: "/pages/workspace/workDetial/zhenggai/zhenggai"
					},
					{
						image: "/static/work/g.png",
						text: "隐患复查",
						url: "/pages/workspace/workDetial/fucha/fucha"
					},

				],
				navBanner3: [{
						image: "/static/work/h.png",
						text: "风险点",
						url: "/pages/workspace/workDetial/points/points"
					},
					{
						image: "/static/work/b.png",
						text: "隐患清单",
						url: "/pages/workspace/workDetial/investigations/investigations",
					},
					{
						image: "/static/work/t1.png",
						text: "隐患排查清单",
						url: "/pages/workspace/workDetial/investigations/dangerCheckList",
					},
					{
						image: "/static/work/i.png",
						text: "企业风险图",
						url: "/pages/workspace/workDetial/riskMap/riskMap"
					},
					// #ifndef MP-ALIPAY
					{
						image: "/static/work/b1.png",
						text: "文档信息",
						url: "/pages/workspace/workDetial/textMenu/textMenu"
					},
					{
						image: "/static/work/b2.png",
						text: "操作规程",
						url: "/pages/workspace/workDetial/detailRull/detailRull"
					},
					// #endif


				],
				navBanner4: [{
						image: "/static/work/f.png",
						text: "随手拍",
						url: "/pages/workspace/workDetial/takePicture/takePicture"
					},
					{
						image: "/static/work/c1.png",
						text: "巡检记录",
						url: "/pages/workspace/workDetial/takePictureList/takePictureList"
					},
					{
						image: "/static/work/e1.png",
						text: "隐患指派",
						url: "/pages/workspace/workDetial/takePictureZhipai/takePictureZhipai"
					},
					{
						image: "/static/work/d2.png",
						text: "隐患处理",
						url: "/pages/workspace/workDetial/takePictureZhenggai/takePictureZhenggai"
					},
					// #ifndef MP-ALIPAY

					// #endif

				],
				navBanner5: [{
						image: "/static/work/a.png",
						text: "扫码巡检",
						url: "/pages/workspace/workDetial/equipmentPolling/equipmentPolling"
					},
					{
						image: "/static/work/e2.png",
						text: "隐患指派",
						url: "/pages/workspace/workDetial/equipment/equipment"
					},
					{
						image: "/static/work/d1.png",
						text: "隐患处理",
						url: "/pages/workspace/workDetial/equipmentZhenggai/equipmentZhenggai"
					},

				],
				navBanner6: [{
						image: "/static/work/t1.png",
						text: "考试管理",
						url: "/pages/workspace/workDetial/exam/exam"
					},
					{
						image: "/static/work/sptb.png",
						text: "视频课程",
						url: "/pages/workspace/workDetial/video/video"
					},
					{
						image: "/static/work/t3.png",
						text: "文件学习",
						url: "/pages/workspace/workDetial/exam/textMenu"
					},
				],
				canvasUrl: '',
				percent: '',
				amapPlugin: null,
				key: '7992d23027ebe8a1b4a812fcac91bfbf',
				addressName: '',
				mask_show: false,
				all_count: {} ,// 全部隐患数量
				
				viode_show:'147369',


			}
		},
		onShow() {
			
			/* this.getZhipai()
			this.getZhenggai()
			this.getFucha()
			this.getTakePictureZhipai()
			this.getTakePictureZhenggai()
			this.getEquipmentZhipai()
			this.getEquipmentZhenggai() */
			this.userIndex()
			this.userInspection_list()
			
			//this.showDiv()
		},
		onLoad() {
			this.company_name = uni.getStorageSync("user").company_name
			this.uid = uni.getStorageSync('user').uid
			this.token = uni.getStorageSync('user').token
			
			this.lists[1].content = '姓名：' + uni.getStorageSync('user').nickname
			// yys为审批用账号,不显示教育模块
			if(uni.getStorageSync('user').nickname == 'yys' || uni.getStorageSync('user').nickname == undefined){
				this.viode_show = '0';
			}
			this.lists[3].content = '地点：' + uni.getStorageSync('addressName')
			this.amapPlugin = new amap.AMapWX({
				key: this.key
			});
			this.getRegeo()
			// #ifdef APP-PLUS
			uni.getSystemInfo({
				success: (res) => {
					//检测当前平台，如果是安卓则启动安卓更新  
					if (res.platform == "android") {
						this.banben = plus.runtime.version;
						this.AndroidCheckUpdate();
					}
				},
			})
			// #endif

		},

		methods: {
			getTime: function() {
				var date = new Date(),
					year = date.getFullYear(),
					month = date.getMonth() + 1,
					day = date.getDate(),
					hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours(),
					minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes(),
					second = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
				month >= 1 && month <= 9 ? (month = "0" + month) : "";
				day >= 0 && day <= 9 ? (day = "0" + day) : "";
				var timer = year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second;
				this.lists[2].content = '时间：' + timer
				return timer;
			},
			beginCanvas() {
				console.log('beginCanvas')
				this.$refs.mosoweCanvasComponents.createCanvas();
			},
			_canvasImage(e) {
				console.log('_canvasImage')
				console.log(e)
				var that = this
				uni.uploadFile({
					url: 'https://aqmore.sxpz.vip/AppApi/Public/uploadImg?c=uperTest',
					filePath: e,
					name: 'file',
					formData: {
						'user': 'test'
					},
					success: uploadFileRes => {
						that.phone = (uploadFileRes.data)
						uni.hideLoading()
						setTimeout(function() {
							that.mask_show = false
							uni.navigateTo({
								url: '../workspace/workDetial/takePicture/takePicture?phone=' +
									that.phone
							})
						}, 1000)
					},
					fail: function(res) {}
				})
			},
			AndroidCheckUpdate: function() {
				var _this = this;
				uni.request({
					url: 'https://aqmore.sxpz.vip/AppApi/Vision/getnew?vision=' + this.banben + '&type=' + this
						.type,
					method: 'GET',
					header: {
						'content-type': 'application/x-www-form-urlencoded',
					},
					success: (res) => {
						// console.log(res)
						_this.apk_url = res.data.datas.info.apk_url
						if (res.data.code == 200 && res.data.datas.code == 400) {
							if (plus.networkinfo.getCurrentType() != 3) {
								uni.showToast({
									title: '有新的版本发布，检测到您目前非Wifi连接，为节约您的流量，程序已停止自动更新，将在您连接WIFI之后重新检测更新。',
									mask: false,
									duration: 5000,
									icon: "none"
								});
								return;
							} else {
								uni.showModal({
									title: "版本更新",
									content: '有新的版本发布，检测到您当前为Wifi连接，是否立即进行新版本下载？',
									showCancel: true,
									confirmText: '立即更新',
									cancelText: '下次登陆',
									success: function(res) {
										if (res.confirm) {
											var dtask = plus.downloader.createDownload(_this
												.apk_url, {},
												function(d,
													status) {
													// 下载完成  
													if (status == 200) {
														plus.runtime.install(plus.io
															.convertLocalFileSystemURL(
																d.filename), {}, {},
															function(error) {
																uni.showToast({
																	title: '安装失败',
																	mask: false,
																	duration: 1500
																});
															})
													} else {
														uni.showToast({
															title: '更新失败',
															mask: false,
															duration: 1500
														});
													}
												});
											dtask.start();

											uni.showToast({
												title: '正在下载中，请稍后...',
												icon: 'none'
											})
										}
										if (res.cancel) {
											console.log('已取消')
										}

									},
								})

							}
						}
					},
					fail: () => {},
					complete: () => {}
				});
			},
			// showDiv() { // 显示输入弹出框
			// 	this.userFeedbackHidden = false;
			// },
			// hideDiv() { // 隐藏输入弹出框
			// 	this.userFeedbackHidden = true;
			// },
			// submitFeedback() { // 提交反馈

			// 	var _this = this;
			// 	// 提交反馈内容
			// 	console.log(_this.feedbackContent);
			// },
			userIndex() {
				var that = this
				uni.request({
					url: 'https://aqmore.sxpz.vip/AppApi/User/index?uid=' + this.uid + '&token=' + this.token,
					method: 'GET',
					header: {
						'content-type': 'application/x-www-form-urlencoded'
					},
					success: function(res) {
						console.log(res)
						that.roll_banner = res.data.datas.banner
						that.is_eqfc = res.data.datas.setting.is_eqfc
						that.is_caw = res.data.datas.setting.is_caw
						
						that.all_count = res
						that.getZhipai()
						that.getZhenggai()
						that.getFucha()
						that.getTakePictureZhipai()
						that.getTakePictureZhenggai()
						that.getEquipmentZhipai()
						that.getEquipmentZhenggai()
						
					}
				})
			},
			userInspection_list() {
				var that = this
				uni.request({
					url: 'https://aqmore.sxpz.vip/AppApi/User/inspection_list?uid=' + this.uid + '&token=' + this
						.token,
					method: 'GET',
					header: {
						'content-type': 'application/x-www-form-urlencoded'
					},
					success: function(res) {

						that.taskPosition = res.data.datas;

					}
				})
			},
			
			getZhipai() { // 隐患排查-隐患指派
				this.signNumber1 = this.all_count.data.datas.safety[0]
				if (this.signNumber1 >= 20) {
					this.signNumber1 = '20⁺'
				}
			},
			getZhenggai() { // 隐患排查-隐患处理
				this.signNumber2 = this.all_count.data.datas.safety[1]
				if (this.signNumber2 >= 20) {
					this.signNumber2 = '20⁺'
				}
			},
			getFucha() { // 隐患排查-隐患复查
				this.signNumber3 = this.all_count.data.datas.safety[2]
				if (this.signNumber3 >= 20) {
					this.signNumber3 = '20⁺'
				}
			},
			getTakePictureZhipai() { // 自增隐患-隐患指派
				this.signNumber4 = this.all_count.data.datas.convenient[0]
				if (this.signNumber4 >= 20) {
					this.signNumber4 = '20⁺'
				}
			},
			getTakePictureZhenggai() { // 自增隐患-隐患处理
				this.signNumber5 = this.all_count.data.datas.convenient[1]
				if (this.signNumber5 >= 20) {
					this.signNumber5 = '20⁺'
				}
			},
			getEquipmentZhipai() { // 设备设施管理-隐患指派
				this.signNumber6 = this.all_count.data.datas.equipment[0]
				if (this.signNumber6 >= 20) {
					this.signNumber6 = '20⁺'
				}
			},
			getEquipmentZhenggai() { // 设备设施管理-隐患处理
				this.signNumber7 = this.all_count.data.datas.equipment[1]
				if (this.signNumber7 >= 20) {
					this.signNumber7 = '20⁺'
				}
			},
			
			/* getZhipai() {
				var that = this
				uni.request({
					url: 'https://aqmore.sxpz.vip/AppApi/SafetyInspection/getAssignList?uid=' + this.uid +
						'&token=' + this.token,
					method: 'GET',
					header: {
						'content-type': 'application/x-www-form-urlencoded'
					},
					success: function(res) {
						if (res.data.code == 100) {
							uni.showToast({
								title: res.data.datas.msg,
								icon: 'none'
							})
							setTimeout(() => {
								uni.reLaunch({
									url: '/pages/index/index'
								})
								try {
									uni.removeStorageSync('user');
								} catch (e) {}
							}, 1500)
							return
						}
						that.signNumber1 = res.data.datas.length
						if (that.signNumber1 >= 20) {
							that.signNumber1 = '20⁺'
						}
					},

				})
			},
			getZhenggai() {
				let that = this
				uni.request({
					url: 'https://aqmore.sxpz.vip/AppApi/SafetyInspection/getRectificationList?uid=' + this.uid +
						'&token=' + this.token,
					method: 'GET',
					header: {
						'content-type': 'application/x-www-form-urlencoded'
					},
					success: function(res) {
						that.signNumber2 = res.data.datas.length
						if (that.signNumber2 >= 20) {
							that.signNumber2 = '20⁺'
						}
					}
				})
			},
			getFucha() {
				let that = this
				uni.request({
					url: 'https://aqmore.sxpz.vip/AppApi/SafetyInspection/getReviewList?uid=' + this.uid +
						'&token=' + this.token,
					method: 'GET',
					header: {
						'content-type': 'application/x-www-form-urlencoded'
					},
					success: function(res) {
						that.signNumber3 = res.data.datas.length
						if (that.signNumber3 >= 20) {
							that.signNumber3 = '20⁺'
						}
					}
				})
			},
			getTakePictureZhipai() {
				var that = this
				uni.request({
					url: 'https://aqmore.sxpz.vip/AppApi/Convenient/getAssignList?uid=' + this.uid + '&token=' +
						this.token,
					method: 'GET',
					header: {
						'content-type': 'application/x-www-form-urlencoded'
					},
					success: function(res) {
						that.signNumber4 = res.data.datas.length
						if (that.signNumber4 >= 20) {
							that.signNumber4 = '20⁺'
						}
					}
				})
			},
			getTakePictureZhenggai() {
				let that = this
				uni.request({
					url: 'https://aqmore.sxpz.vip/AppApi/Convenient/getRectificationList?uid=' + this.uid +
						'&token=' + this.token,
					method: 'GET',
					header: {
						'content-type': 'application/x-www-form-urlencoded'
					},
					success: function(res) {
						that.signNumber5 = res.data.datas.length
						if (that.signNumber5 >= 20) {
							that.signNumber5 = '20⁺'
						}
					}
				})
			},
			getEquipmentZhipai() {
				var that = this
				uni.request({
					url: 'https://aqmore.sxpz.vip/AppApi/Equipment/getAssignList?uid=' + this.uid + '&token=' +
						this.token,
					method: 'GET',
					header: {
						'content-type': 'application/x-www-form-urlencoded'
					},
					success: function(res) {
						that.signNumber6 = res.data.datas.length
						if (that.signNumber6 >= 20) {
							that.signNumber6 = '20⁺'
						}
					}
				})
			},
			getEquipmentZhenggai() {
				let that = this
				uni.request({
					url: 'https://aqmore.sxpz.vip/AppApi/Equipment/getRectificationList?uid=' + this.uid +
						'&token=' + this.token,
					method: 'GET',
					header: {
						'content-type': 'application/x-www-form-urlencoded'
					},
					success: function(res) {
						that.signNumber7 = res.data.datas.length
						if (that.signNumber7 >= 20) {
							that.signNumber7 = '20⁺'
						}
					}
				})
			}, */
			toDetail(e) {
				var that = this
				if (e == "/pages/workspace/workDetial/polling/polling") {
					uni.scanCode({
						success: function(res) {
							let scene = res.result.split('=');
							let e1 = scene[0].split('?')
							let e = scene[1].split('&');
							let e2 = scene[1].split('?')[0].split('&');
							uni.request({
								url: 'https://aqmore.sxpz.vip/AppApi/Danger/detail?danger_id=' + e2[0],
								method: 'GET',
								header: {
									'content-type': 'application/x-www-form-urlencoded'
								},
								success: function(res) {
									that.danger_status = res.data.datas.danger.danger_status
									if (that.danger_status == 1) {
										uni.navigateTo({
											url: '../workspace/workDetial/polling/polling?id=' +
												e[0]
										})
									} else if (that.danger_status == 3) {
										uni.showToast({
											title: '该二维码为设备设施二维码，请扫描风险点二维码',
											icon: 'none'
										})
									} else {
										uni.showToast({
											title: '请扫描正确的二维码',
											icon: 'none'
										})
										return false
									}
								}
							})
						},
						fail: function() {
							uni.showToast({
								title: '请扫描二维码',
								icon: 'none'
							})
						}
					})
				} else if (e == "/pages/workspace/workDetial/equipmentPolling/equipmentPolling") {
					uni.scanCode({
						success: function(res1) {
							let scene = res1.result.split('=');
							let e1 = scene[0].split('?')
							let e = scene[1].split('&');
							let e2 = scene[1].split('?')[0].split('&');
							uni.request({
								url: 'https://aqmore.sxpz.vip/AppApi/Danger/detail?danger_id=' + e2[0],
								method: 'GET',
								header: {
									'content-type': 'application/x-www-form-urlencoded'
								},
								success: function(res) {
									that.danger_status = res.data.datas.danger.danger_status
									console.log(that.danger_status)
									if (that.danger_status == 3) {
										uni.navigateTo({
											url: '../workspace/workDetial/equipmentPolling/equipmentPolling?id=' +
												e[0]
										})
									} else if (that.danger_status == 1) {
										uni.showToast({
											title: '该二维码是风险点二维码，请扫描设备设施二维码',
											icon: 'none'
										})
									} else {
										uni.showToast({
											title: '请扫描正确的二维码',
											icon: 'none'
										})
										return false
									}
								},
							})
						}
					})
				} else if (e == "/pages/workspace/workDetial/takePicture/takePicture") {
					// this.mask_show=true
					let that = this
					uni.chooseImage({
						count: 1,
						sizeType: ['compressed'],
						sourceType: ['camera', 'album'],
						success: res => {
							// console.log(JSON.stringify(res.tempFilePaths));
							const tempFilePaths = res.tempFilePaths;
							uni.uploadFile({
								url: 'https://aqmore.sxpz.vip/AppApi/Public/uploadImg?c=uperTest',
								filePath: tempFilePaths[0],
								name: 'file',
								formData: {
									'user': 'test'
								},
								success: uploadFileRes => {
									that.phone = (uploadFileRes.data)
									uni.showToast({
										title: '照片上传中',
										icon: 'loading'
									})
									setTimeout(function() {
										uni.navigateTo({
											url: '../workspace/workDetial/takePicture/takePicture?phone=' +
												that.phone
										})
									}, 1500)
								}
							})
						},
					})
					/* uni.chooseImage({
						count: 1,
						sizeType: ['compressed'],
						sourceType: ['camera', 'album'],
						success: res => {
							uni.showLoading({
								title:'图片上传中',
								mask: true
							})
							const tempFilePaths = res.tempFilePaths;
							// 获取图片信息
							uni.getImageInfo({
								src: res.tempFilePaths[0],
								success: function(image) {
									console.log(image.width);
									// 画图的布局
									that.lists[0].width = image.width + 20
									that.lists[0].height = image.height + 20
									that.lists[1].y = image.height - 60
									that.lists[2].y = image.height
									that.lists[3].y = image.height - 30
									console.log(that.lists[0].height);
								},
								fail: function(res) {
									console.log('失败了')
									console.log(res)
								}
							});
							const uploadTask = uni.uploadFile({
								url: 'https://aqmore.sxpz.vip/AppApi/Public/uploadImg?c=uperTest',
								filePath: tempFilePaths[0],
								name: 'file',
								formData: {
									'user': 'test'
								},
								success: uploadFileRes => {
									that.getTime()
									that.canvasUrl = (uploadFileRes.data).replace("http:", "https:")
									that.lists[0].content = (uploadFileRes.data).replace("http:", "https:")
									setTimeout(function() {
										that.beginCanvas()
									}, 500)
								}
							})
							
						},
						fail:function(){
							that.mask_show=false
						}

					}) */

				} else if (e == '/pages/workspace/workDetial/video/videDetail') {
					uni.navigateTo({
						url: 'workDetial/video/videDetail?i=' + 1
					})
				} else if (e == '') {
					uni.showToast({
						title: '功能正在开发中敬请期待...',
						icon: 'none'
					})
				} else {
					uni.navigateTo({
						url: e
					})
				}
			},
			banner_tap(i) {
				uni.navigateTo({
					url: "workDetial/BannerInformation/BannerInformation?text=" + i
				})
				// console.log(i)
			},
			getRegeo() {
				var that = this
				this.amapPlugin.getRegeo({
					// success: (data) => {
					// },
					success: function(data) {
						// console.log(data)
						var add = data[0].name;
						uni.setStorageSync('addressName', add)
						this.addressName = data[0].name;

						console.log(this.addressName)
						uni.hideLoading();
						//成功回调
					},
					fail: (err) => {
						console.log(err)
					}
				});

			}

		}
	}
</script>

<style>
	page {
		margin: 0;
		padding: 0;
		/* background-color: #0d98ed; */
	}

	.mask {
		position: fixed;
		top: 0;
		left: 0;
		z-index: 999;
		width: 100%;
		height: 100vh;
		background: rgba(0, 0, 0, 0.4);

	}

	.conductSign {
		position: absolute;
		right: 10%;
		top: -10upx;
		color: #fff;
		background-color: #FF2400;
		border-radius: 50%;
		padding: 0 10upx;
	}

	.img_bg {
		width: 100%;
		height: 100%;
		position: fixed;
		background-size: 100% 100%;
		z-index: -1;
	}

	.flex-wrap {
		flex-wrap: wrap;
	}

	.align-start {
		align-items: flex-start;
	}

	.imgst {
		width: 100%;
		height: 400upx;
	}

	.navImage {
		position: relative;
		width: 100%;
		height: 100%;
	}

	/* 轮播图 */
	.workSwiper {
		padding: 0;
		width: 100%;
		height: 400upx;
		border-radius: 25upx;

	}

	.swiper-item {
		padding: 0;
		width: 100%;
		height: 400upx;
		border-radius: 25upx;
	}

	image {
		height: 100%;
		width: 100%;
	}



	.roll {
		margin-left: 30upx;
		margin-right: 30upx;
		margin-top: 30upx;

	}

	/* 功能模块 */
	.card1 {
		background-color: #ffffff;
		box-shadow: 0 2upx 8upx 0 rgba(0, 0, 0, 0.06);
		border-radius: 20upx;
		padding: 30upx 24upx;
		margin-top: 30upx;
		margin-left: 30upx;
		margin-right: 30upx;
	}

	.button-st {
		width: 25%;
		margin-top: 30upx;
		text-align: center;
		font-size: 33upx;
		position: relative;
		border-radius: 5%;
		transition: all 0.6;
	}

	.butt-h {
		top: 15upx;
		transform: scale(1.6);
		font-size: 0upx;
	}

	.siz_img {
		height: 90upx;
		width: 90upx;
		margin-left: 22%;

	}

	/* .big_img{
	position: absolute;	
	top: 15upx;
	height: 150upx;
	width: 150upx;
	transform: scale(1.6);
} */
	.father {
		position: relative;
	}

	.swiper {
		z-index: 5;
		height: 400upx;
	}

	.workSwiper {
		width: 100%;
		height: 400upx;
		border-radius: 20upx;
	}

	.popup_overlay {

		position: fixed;
		top: 0%;
		left: 0%;
		width: 100%;
		height: 100%;
		background-color: black;
		z-index: 1001;
		-moz-opacity: 0.8;
		opacity: .80;
		filter: alpha(opacity=88);
	}

	.popup_content {
		position: fixed;
		top: 50%;
		left: 50%;
		width: 520upx;
		height: 550upx;
		margin-left: -270upx;
		margin-top: -270upx;
		border: 10px solid white;
		background-color: white;
		z-index: 1002;
		overflow: auto;
		border-radius: 20upx;
	}

	.popup_title {
		padding-top: 20upx;
		width: 480upx;
		text-align: center;
		font-size: 32upx;
		color: #FF5400;
	}
</style>
